home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / doc.zoo / doc / usrman / INDEX < prev    next >
Encoding:
Text File  |  1989-03-28  |  983 b   |  41 lines

  1. #!/bin/sh
  2. #                        Copyright (c) 1988 Bellcore
  3. #                            All Rights Reserved
  4. #       Permission is granted to copy or use this program, EXCEPT that it
  5. #       may not be sold for profit, the copyright notice must be reproduced
  6. #       on copies, and credit should be given to Bellcore where it is due.
  7. #       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  8.  
  9. #    $Header: INDEX,v 4.2 88/06/30 12:44:46 bianchi Exp $
  10. #    $Source: /tmp/mgrsrc/doc/usrman/RCS/INDEX,v $
  11.  
  12.  
  13. # make an index from troff index generation pass
  14.  
  15. grep '^[a-z]' $*  |
  16.     sort  +0 -1 -d  +1 -2 -n +2 -3 -r  |
  17.     awk '
  18.     BEGIN    {
  19.             name = ""
  20.             num = 0
  21.             printf ".na\n.Ih"
  22.         }
  23.     name != $1 {
  24.             name = $1
  25.             printf "\n.br\n%s", $1
  26.             num = 0
  27.         }
  28.     num != $2 {
  29.             if( num != 0 )
  30.                 printf ","
  31.             if ($3 == "*")    # defining reference
  32.                 printf " \\fB%s\\fP",$2
  33.             else        # additional reference
  34.                 printf " %s", $2
  35.             num = $2
  36.         }
  37.     END    {
  38.             printf "\n.br\n.ad\n"
  39.         }
  40.     '
  41.